/*-------------------------------------------------------------------------

***************** Modification History ***********************************
   @doc
   @module gds.h - Header file for global structure |
   @end
   
$Log: /SoftPay/SPK2SIM/Source/Include/gds.h $ 
**************************************************************************

   Copyright (C) 1999 by VeriFone, Inc.

   All rights reserved.  No part of this software may be reproduced,
   transmitted, transcribed, stored in a retrieval system, or translated
   into any language or computer language, in any form or by any means,
   electronic, mechanical, magnetic, optical, chemical, manual or otherwise,
   without the prior written permission of VeriFone, Inc.

---------------------------------------------------------------------------*/

#include <define.h>

#ifndef vsgds
#define vsgds

#ifdef MESSENGER_DEFINED	

// Structure for Messenger/Tmail flags
typedef struct MessengerFlags
{
    unsigned fNewMail:1;           
    unsigned fVoucherExists:1;     
    unsigned fReportExists:1;       
    
} MESSENGER_FLAGS_REC;

#define MESSENGER_FLAGS_SIZE sizeof(MESSENGER_FLAGS_REC)

#endif

// Generic Status Level Structure
typedef struct StatusLevel
{
	unsigned	long	lnRawValue;			// Current/last measurement raw value
	unsigned 	long	lnMaxValue;			// Maximum value (used for % Calculation)
	short				shPercentage;		// Current/last measurement value as percentage
	short				shGraphicIndex;		// Current/last measurement index for graphic
} STATUS_LEVEL;

/* All the common global data is stored in this structure */

typedef struct TagGDS
{
    /* 
     *      New and improved true Glodal Data Space
     */
    long    lnErrorMessageIndex;                           	/* Error Message       */

    // Checkreader data
	int     inCheckReaderHandle;
	int     inChkrdrPort;
	VS_BOOL fCheckSwipeFromIdle;

	// Idle Timeout Time
	unsigned long ulIdleTimerCount;
	VS_BOOL fResetIdleTimer;

	// Monitored Item support
	short shDoW;

	// Clerk/Server data
	char 	szClerkIdFromPW[CLERK_ID_SIZE + 1];				/* Clerk ID associate with PW ENTERed */

	// Terminal Model No.
	char modelNo[MAX_TERMINAL_NAME_SIZE + 1];

	// Battery Operated terminal data
	VS_BOOL fBatteryOperated;
	STATUS_LEVEL srBatteryStatus;

	// Wireless terminal data
	VS_BOOL	fWirelessModem;
	VS_BOOL	fWirelessActive;
	STATUS_LEVEL srWirelessSignalStatus;

	// HandHeld terminal data
	VS_BOOL fHandHeld;

	// General terminal data
	VS_BOOL fLandLine;
	VS_BOOL fTDK_MODEM;
	VS_BOOL fSoftFormFeedKey;

	// Flag to indicate processing an external event
	VS_BOOL fExternalEvent;
	
	// Messenger data
#ifdef MESSENGER_DEFINED	
    MESSENGER_FLAGS_REC srMessengerFlags;
#endif

	//SoftpayActive Flag (VMAC)
	VS_BOOL fSoftPayActive;			//meca 20041023 -- for auto-processing in multi-app environment (bruce/sadiq)
	
} GDS;

#define GDS_SIZE sizeof(GDS)

extern GDS srGDS;


#endif /* vsgds */
